package com.learn.hmspring.service.impl;

import com.learn.hmspring.dao.AccountDao;
import com.learn.hmspring.domain.Account;
import com.learn.hmspring.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    public AccountDao ad;

    public void saveAccount(Account account) {
        ad.saveAccount(account);
    }

    public Account findAccountById(Integer id) {
        int i = 1/0;
        return ad.findAccountById(id);
    }

    public void updateAccount(Account account) {
        ad.updateAccount(account);
    }

    public void deleteAccount(Account account) {
        ad.deleteAccount(account);
    }

    public List<Account> findAllAccount() {
        return ad.findAllAccount();
    }
}
